using System;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class User_Login : System.Web.UI.Page
{
    protected Authenticate authen;
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void Login1_Authenticate(object sender, AuthenticateEventArgs e)
    {
        authen = new Authenticate();
        bool Authenticated = false; ;
        int UserStatus = -1;
        UserStatus = authen.UserAuthenticate(Login1.UserName,Login1.Password);
        
        if (UserStatus != -1)
        {
            Session["UserName"] = Login1.UserName;
            Authenticated = true;
            e.Authenticated = Authenticated;
            
        }
        if (UserStatus == 0)
        {            
            Response.Redirect("Home.aspx");
        }
        if (UserStatus == 1)
        {
            Response.Redirect("ExpertInfo.aspx");
        }
        if (UserStatus == 2)
        {
            Response.Redirect("Admin.aspx");
        }
        

    }
   
}